<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    x:Class="OpenLS.Spreadsheet.UI.CommentResources"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ss="http://schemas.Kherty.com/office/2007/spreadsheet"
    xmlns:ssui="clr-namespace:OpenLS.Spreadsheet.UI" xmlns:Internals="clr-namespace:OpenLS.Spreadsheet.UI.Internals">
    <ssui:TextParagraphConverter x:Key="textParagraphConverter"/>
    <DataTemplate DataType="{x:Type ss:Comment}">
        <TextBox GotFocus="root_GotFocus"  KeyDown="RootKeyDown" LostFocus="RootLostFocus"
                 Name="commentRoot" Text="{Binding Path=Text, Converter={StaticResource textParagraphConverter}, Mode=TwoWay}"
                 AcceptsReturn="True" Visibility="Collapsed"
                 Background="#ffffe1" Loaded="root_Loaded" >
        </TextBox>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding IsVisible}" Value="True">
                <Setter Property="Visibility" Value="Visible" TargetName="commentRoot"/>
            </DataTrigger>
            <Trigger Property="Internals:CommentElement.IsEdited" SourceName="commentRoot" Value="True">
                <Setter Property="Visibility" Value="Visible" TargetName="commentRoot"/>
            </Trigger>
            <DataTrigger Value="True">
            	<DataTrigger.Binding>
                    <MultiBinding >
                        <MultiBinding.Converter>
                            <ssui:MultiEqualConverter />
                        </MultiBinding.Converter>
                        <Binding Path="(Internals:EditionElement.HoverCell)" RelativeSource="{RelativeSource Self}"></Binding>
            		<Binding Path="Cell" />
                    </MultiBinding>
            	</DataTrigger.Binding>
                <Setter Property="Visibility" Value="Visible" TargetName="commentRoot"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

</ResourceDictionary>